/* 
 * File:   commands.h
 * Author: Bram
 *
 * Created on 8 november 2014, 15:50
 */

#ifndef COMMANDS_H
#define	COMMANDS_H

#ifdef	__cplusplus
extern "C" {
#endif

#include "FreeRTOS.h"
#include "queue.h"
    
    enum COMMAND_ID {
        CMD_MONITORING_SET = 1,
        CMD_MONITORING_SEND,

        CMD_ESC_ADDRESSES,
        CMD_ESC_INFO,
        CMD_ESC_BOOTLOADER,
        CMD_ESC_FIRMWARE_FLASH_ROW,
        CMD_ESC_FIRMWARE_WRITE_CONFIG,
        CMD_ESC_SETTINGS,
        CMD_ESC_SETTING_SET,
        CMD_ESC_SETTINGS_WRITE,
        CMD_ESC_SET_DEBUG_RPM,
        CMD_ESC_GET_DEBUG_FEEDBACK,
        CMD_MOTOR_BODE,

        CMD_ESC_SET_MODE_OFF,
        CMD_ESC_SET_MODE_FLIGHT,
        
        CMD_CONFIG_SEND_ALL,
        CMD_CONFIG_VALUE,
        CMD_CONFIG_WRITE_SD,
        CMD_CONFIG_READ_SD,

        CMD_LOG_SEND_DEFINITIONS,
        CMD_LOG_SET_INTERVAL,
        CMD_LOG_RETRIEVE_ALL,
        CMD_LOG_DATA_REALTIME,
        CMD_LOG_DATA_SD,

        CMD_DEBUG_RC,
        CMD_DEBUG_STRING,

        CMD_SD_READ_FILES,
        CMD_SD_READ_FILE,
        CMD_SD_FORMAT,
        CMD_SD_RAW_READ,
        CMD_LOG_STATUS,
        CMD_LOG_MANUAL_ENABLE,
        CMD_LOG_MANUAL_DISABLE

    };


struct CommandIn_t
{
    enum COMMAND_ID command;
    int paramPosition;
    int paramLength;
};

struct commandConfig_t
{
    void (* function)();
    const QueueHandle_t * queue;
};

void commandPost(const struct CommandIn_t * cmd);

void (* commandGetFunction(enum COMMAND_ID cmd))();

#ifdef	__cplusplus
}
#endif

#endif	/* COMMANDS_H */

